import SelectRoles from './componets/select-roles.vue'
import {markRaw} from 'vue'

export const addSchema: FormSchema = {
    "style": {
        "width": "auto"
    },
    "formItemLayout": {
        "labelCol": {
            "span": 4
        },
        "wrapperCol": {
            "span": 20
        }
    },
    "formItem": [
        {
            "type": "input",
            "label": "账号",
            "key": "account",
            "value": "",
            "props": {
                "placeholder": "账号"
            },
            "rules": [
                {
                    "required": true,
                    "message": "账号不能为空"
                }
            ]
        },
        {
            "type": "input",
            "label": "姓名",
            "key": "username",
            "value": "",
            "props": {
                "placeholder": "姓名"
            },
            "rules": [
                {
                    "required": true,
                    "message": "姓名不能为空"
                }
            ]
        },
        {
            "type": "input",
            "label": "密码",
            "key": "password",
            "value": "",
            "props": {
                type: "password",
                "placeholder": "密码"
            },
            "rules": [
                {
                    "required": true,
                    "message": "密码不能为空"
                }
            ]
        },
        {
            "type": "input",
            "label": "电话",
            "key": "tel",
            "value": "",
            "props": {
                "placeholder": "电话"
            }
        },
        {
            "type": "input",
            "label": "email",
            "key": "email",
            "value": "",
            "props": {
                "placeholder": "邮箱地址"
            }
        },
        {
            "type": "component",
            "label": "选择角色",
            "key": "roleid",
            "value": "",
            "component": markRaw(SelectRoles),
            "props": {
                "placeholder": "请选择相应的角色"
            },
            "rules": [
                {
                    "required": true,
                    "message": "请选择角色"
                }
            ]
        },
    ]
}
